library(help=soil.spec)
library(soil.spec)
library(cluster)
#
#library(help=cluster)
#
data(ruspini)
#
plot(ruspini)
ken.sto(ruspini, 4, va = "FALSE", sav = "FALSE", save.path = "NULL", output.name = "Sample selection")
ken.sto(ruspini, 4, va = "FALSE", sav = "FALSE")
ken.sto(ruspini, 4, per=FALSE, va = FALSE, sav = FALSE)
library(ade4);library(MASS);library(cluster);library(mclust) ###################################################################################
# Majorization#
DistCo<-function(vet1,vet2,s)#
{uk<-length(vet1);temp<-0#
 for (i in 1:uk)#
     {fact<-max(vet1[i]/vet2[i],vet2[i]/vet1[i])#
      temp<-temp+fact^s}#
      temp<-(temp)^(1/s)#
return(temp)#
}#
##
Titol<- "Simulated 3G"#
Comp<-read.table("ThreeGroups.csv",sep=",",dec=".",header=TRUE,row.names=1)#
##
Comp<-data.frame(Comp)#
p<-nrow(Comp);p1<-p-1#
Taps<-matrix(0,p,p)#
for(i in 1:p1)#
    {i1<-i+1#
     for (j in i1:p)#
    	   {Vec1<-as.vector(Comp[i,],mode="numeric")#
	       Vec2<-as.vector(Comp[j,],mode="numeric")#
    	   	Taps[i,j]<-DistCo(Vec1,Vec2,2);Taps[j,i]<-Taps[i,j]}}
library(ade4);library(MASS);library(cluster);library(mclust) ###################################################################################
# Majorization#
DistCo<-function(vet1,vet2,s)#
{uk<-length(vet1);temp<-0#
 for (i in 1:uk)#
     {fact<-max(vet1[i]/vet2[i],vet2[i]/vet1[i])#
      temp<-temp+fact^s}#
      temp<-(temp)^(1/s)#
return(temp)#
}#
##
Titol<- "Simulated 3G"#
Comp<-read.table("ThreeGroups.csv",sep=",",dec=".",header=TRUE,row.names=1)#
##
Comp<-data.frame(Comp)#
p<-nrow(Comp);p1<-p-1#
Taps<-matrix(0,p,p)#
for(i in 1:p1)#
    {i1<-i+1#
     for (j in i1:p)#
    	   {Vec1<-as.vector(Comp[i,],mode="numeric")#
	       Vec2<-as.vector(Comp[j,],mode="numeric")#
    	   	Taps[i,j]<-DistCo(Vec1,Vec2,2);Taps[j,i]<-Taps[i,j]}}
library(ade4);library(MASS);library(cluster);library(mclust) ###################################################################################
# Majorization#
DistCo<-function(vet1,vet2,s)#
{uk<-length(vet1);temp<-0#
 for (i in 1:uk)#
     {fact<-max(vet1[i]/vet2[i],vet2[i]/vet1[i])#
      temp<-temp+fact^s}#
      temp<-(temp)^(1/s)#
return(temp)#
}#
##
Titol<- "Simulated 3G"#
Comp<-read.table("ThreeGroups.csv",sep=",",dec=".",header=TRUE,row.names=1)#
##
Comp<-data.frame(Comp)#
p<-nrow(Comp);p1<-p-1#
Taps<-matrix(0,p,p)#
for(i in 1:p1)#
    {i1<-i+1#
     for (j in i1:p)#
    	   {Vec1<-as.vector(Comp[i,],mode="numeric")#
	       Vec2<-as.vector(Comp[j,],mode="numeric")#
    	   	Taps[i,j]<-DistCo(Vec1,Vec2,2);Taps[j,i]<-Taps[i,j]}}
TAPS
Taps
h<-which-
h<-which.max(Taps)
h
h<-which.max(Taps,arrayInd=TRUE)
arrayInd()
h<-which.max(Taps,arr.ind=TRUE)
arrayInd(h, .dim, .dimnames = NULL, useNames = FALSE)
library(ade4);library(MASS);library(cluster);library(mclust)
h<-which.max(Taps,arr.ind=TRUE)
y
